import {createTableOption} from '@/utils/util'

export const tableOption = function () {
    let self = this
    return createTableOption({
        searchMenuSpan: 6,
        searchSpan: 6,
        header: true,
        index: false,
        menu: false,
        dialogCustomClass: 'crud-dialog',
        lazy: true,
        rowKey: 'id',
        column: [
            {
                label: '船企名称',
                prop: 'tenantId',
                hide: true,
                search: true,
                filterable: true,
                type: 'select',
                dicData: self.tenantArr,
                change(row) {
                    // if (self.searchForm.tenantId !== row.value) {
                        self.getShip(row.value)
                    // }
                }
            },
            {
                label: '船舶名称',
                prop: 'shipId',
                hide: true,
                search: true,
                filterable: true,
                type: 'select',
                dicData: self.shipArr,
            },
            {
                label: '告警日期',
                search: true,
                prop: 'createTime',
                hide: true,
                type: 'datetime',
                format: 'yyyy-MM-dd HH:mm:ss',
                valueFormat: 'yyyy-MM-dd HH:mm:ss',
                startPlaceholder: '告警开始时间',
                endPlaceholder: '告警结束时间',
                defaultTime: ['00:00:00', '23:59:59'],
                searchRange: true,
                editDisplay: false,
                addDisplay: false,
                width: 160
            },
            {
                label: "公司名称/船舶名称",
                prop: "name",
            },
            {
                label: '告警发生总数',
                prop: 'warnTotalCount',
            },
            {
              label: '告警处理次数',
                prop: 'warnProcessCount',
            },
          // {
          //     label: '误报警次数',
          //     prop: 'warnErrorCount',
          // },
            {
                label: '处理闭环率',
                prop: 'processCloseRate',
            },
          // {
          //     label: '误报警率',
          //     prop: 'errorRate',
          // },
            {
                label: '处理及时率',
                prop: 'processTimelyRate',
            }
        ]
    })
}
